package com.legendshop.openportal.sdk.client;

import com.legendshop.openportal.sdk.client.http.HttpResponseHandler;
import com.legendshop.openportal.sdk.model.BaseRequest;
import com.legendshop.openportal.sdk.model.BaseResponse;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author jzh
 * @version 1.0.0
 * @title ClientExecutionParams
 * @date 2024/6/18 10:54
 * @description：
 */
@Data
public class ClientExecutionParams<input extends BaseRequest, output> {

    /**
     * 需要认证访问
     */
    private Boolean isAuth;

    /**
     * 请求
     */
    private input request;

    /**
     * 是否是body请求
     */
    private boolean isBody;

    /**
     * 响应处理器
     */
    private HttpResponseHandler<output> responseHandler;

    public ClientExecutionParams(input request, HttpResponseHandler<output> responseHandler) {
        this.isAuth = true;
        this.isBody = false;
        this.request = request;
        this.responseHandler = responseHandler;
    }

    public ClientExecutionParams(Boolean isAuth, input request, HttpResponseHandler<output> responseHandler) {
        this.isAuth = isAuth;
        this.isBody = false;
        this.request = request;
        this.responseHandler = responseHandler;
    }

    public ClientExecutionParams(Boolean isAuth, input request, boolean isBody, HttpResponseHandler<output> responseHandler) {
        this.isAuth = isAuth;
        this.isBody = isBody;
        this.request = request;
        this.responseHandler = responseHandler;
    }

}
